package com.ruoyi.laiqianba.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SmsConfigInfoMapper;
import com.ruoyi.db.domain.SmsConfigInfo;
import com.ruoyi.laiqianba.service.ISmsConfigInfoService;

/**
 * 短信配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-13
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SmsConfigInfoServiceImpl implements ISmsConfigInfoService 
{
    @Autowired
    private SmsConfigInfoMapper smsConfigInfoMapper;

    /**
     * 查询短信配置
     * 
     * @param id 短信配置主键
     * @return 短信配置
     */
    @Override
    public SmsConfigInfo selectSmsConfigInfoById(Long id)
    {
        return smsConfigInfoMapper.selectSmsConfigInfoById(id);
    }

    /**
     * 查询短信配置列表
     * 
     * @param smsConfigInfo 短信配置
     * @return 短信配置
     */
    @Override
    public List<SmsConfigInfo> selectSmsConfigInfoList(SmsConfigInfo smsConfigInfo)
    {
        return smsConfigInfoMapper.selectSmsConfigInfoList(smsConfigInfo);
    }

    /**
     * 新增短信配置
     * 
     * @param smsConfigInfo 短信配置
     * @return 结果
     */
    @Override
    public int insertSmsConfigInfo(SmsConfigInfo smsConfigInfo)
    {
        smsConfigInfo.setCreateTime(DateUtils.getNowDate());
        return smsConfigInfoMapper.insertSmsConfigInfo(smsConfigInfo);
    }

    /**
     * 修改短信配置
     * 
     * @param smsConfigInfo 短信配置
     * @return 结果
     */
    @Override
    public int updateSmsConfigInfo(SmsConfigInfo smsConfigInfo)
    {
        smsConfigInfo.setUpdateTime(DateUtils.getNowDate());
        return smsConfigInfoMapper.updateSmsConfigInfo(smsConfigInfo);
    }

    /**
     * 批量删除短信配置
     * 
     * @param ids 需要删除的短信配置主键
     * @return 结果
     */
    @Override
    public int deleteSmsConfigInfoByIds(Long[] ids)
    {
        return smsConfigInfoMapper.deleteSmsConfigInfoByIds(ids);
    }

    /**
     * 删除短信配置信息
     * 
     * @param id 短信配置主键
     * @return 结果
     */
    @Override
    public int deleteSmsConfigInfoById(Long id)
    {
        return smsConfigInfoMapper.deleteSmsConfigInfoById(id);
    }
}
